/**JMS开发基本步骤：
 * 1.ConnectionFactory：QueueConnectionFactory、TopicConnectionFactory
 * 2.Connection:QueueConnection、TopicConnection
 * 3.connection.start
 * 4.Session:QueueSession、TopicSession
 * 5.Destination:Queue、Topic
 * 6.Message:5种
 * 7.Producer:QueueSender、TopicPublisher--send
 * 8.Consumer:QueueReceiver、TopicSubscriber--receive/onMessage
 * 9.Close
 */
public class Main {
    public static void main(String[] args) {
        try {
//            AdvancedProducer.transactionProducer();
//            AdvancedConsumer.tansactionReceiver();

            AdvancedProducer.ackProducer();
            AdvancedConsumer.ackReceiver();

//            AdvancedProducer.asyncProducer();
//            AdvancedConsumer.commonReceiver("asyncQueue");

//            AdvancedProducer.delayProducer();
//            AdvancedConsumer.commonReceiver("delayQueue",false);


//              AdvancedProducer.deadProducer();
//              AdvancedConsumer.commonReceiver("ActiveMQ.DLQ", false);

//            new Thread(()->AdvancedConsumer.durbleReceiver()).start();
//            AdvancedProducer.topicProducer();
//            AdvancedConsumer.durbleReceiver();


        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
